package com.itheima.d4_byte_stream;

import java.io.*;

public class CopyTest5 {
    public static void main(String[] args) throws IOException {
        InputStream is=new FileInputStream("C:\\Users\\dell\\IdeaProjects\\file-io-app\\src\\img.png");
        OutputStream os=new FileOutputStream("C:\\Users\\dell\\IdeaProjects\\file-io-app\\src\\img2.png");

        byte[] buffer=new byte[1024];

        int len;
        while((len=is.read(buffer))!=-1){
            os.write(buffer,0,len);
        }

        os.close();
        is.close();
        System.out.println("复制完成");
    }
}
